﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Distributors.aspx.cs" Inherits="Ebiz.Distributors" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script src="js/distributors.js" type="text/javascript"></script>
    <script type="text/javascript">
        var btnSave = "<%= btnSave.ClientID %>";
        var hMode = "<%= hMode.ClientID %>";
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentHolder" runat="server">
    <h3>Distributor List</h3>
    <form name="Form1" id="Form1" method="post" runat="server">
        <div style="margin:0 auto; position:relative; width:98%;">
            <table id="tblInfo" align="center" cellpadding="6" cellspacing="0" style="margin-bottom:30px;font-size: 12px; font-family: Arial;display:none;">
                <tr>
                    <td style="text-align:left;padding:5px 0;width:150px;">Distributor Code &nbsp;<asp:RequiredFieldValidator 
                            ID="RequiredFieldValidator1" runat="server" 
                            ErrorMessage="Distributor Code is required" ControlToValidate="txtCode" 
                            ValidationGroup="INSERTNEW">*</asp:RequiredFieldValidator>
                    </td>
                    <td>:</td>
                    <td style="text-align:left;width:210px;">
                        <asp:Label ID="lblCode" CssClass="spnInfo" runat="server" Text="Label"></asp:Label>
                        <asp:TextBox ID="txtCode" CssClass="txtInfo" runat="server" MaxLength="3" 
                            Width="100%"></asp:TextBox></td>
                </tr>
                <tr>
                    <td style="text-align:left;padding:5px 0;">Distributor Name &nbsp;<asp:RequiredFieldValidator 
                            ID="RequiredFieldValidator2" runat="server" 
                            ErrorMessage="Distributor Name is required" ControlToValidate="txtName" 
                            ValidationGroup="INSERTNEW">*</asp:RequiredFieldValidator>
                    </td>
                    <td>:</td>
                    <td style="text-align:left;">
                        <asp:Label ID="lblName" CssClass="spnInfo" runat="server" Text="Label"></asp:Label>
                        <asp:TextBox ID="txtName" CssClass="txtInfo" runat="server" Width="100%"></asp:TextBox></td>
                </tr>
                <tr>
                    <td style="text-align:left;padding:5px 0;">PIC Name &nbsp;<asp:RequiredFieldValidator 
                            ID="RequiredFieldValidator3" runat="server" 
                            ErrorMessage="PIC Name is required" ControlToValidate="txtName" 
                            ValidationGroup="INSERTNEW">*</asp:RequiredFieldValidator>
                    </td>
                    <td>:</td>
                    <td style="text-align:left;">
                        <asp:Label ID="lblPICName" CssClass="spnInfo" runat="server" Text="Label"></asp:Label>
                        <asp:TextBox ID="txtPICName" CssClass="txtInfo" runat="server" Width="100%"></asp:TextBox></td>
                </tr>
                <tr>
                    <td style="text-align:left;padding:5px 0;">PIC Name (on CL) &nbsp;<asp:RequiredFieldValidator 
                            ID="RequiredFieldValidator4" runat="server" 
                            ErrorMessage="PIC Name (on CL) is required" ControlToValidate="txtName" 
                            ValidationGroup="INSERTNEW">*</asp:RequiredFieldValidator>
                    </td>
                    <td>:</td>
                    <td style="text-align:left;">
                        <asp:Label ID="lblPICNameCL" CssClass="spnInfo" runat="server" Text="Label"></asp:Label>
                        <asp:TextBox ID="txtPICNameCL" CssClass="txtInfo" runat="server" Width="100%"></asp:TextBox></td>
                </tr>
                <tr>
                    <td style="text-align:left;padding:5px 0;">Address &nbsp;<asp:RequiredFieldValidator 
                            ID="RequiredFieldValidator5" runat="server" 
                            ErrorMessage="Address is required" ControlToValidate="txtName" 
                            ValidationGroup="INSERTNEW">*</asp:RequiredFieldValidator>
                    </td>
                    <td>:</td>
                    <td style="text-align:left;">
                        <asp:Label ID="lblAddress" CssClass="spnInfo" runat="server" Text="Label"></asp:Label>
                        <asp:TextBox ID="txtAddress" runat="server"  CssClass="txtInfo"
                            TextMode="MultiLine" Width="100%"></asp:TextBox></td>
                </tr>
                <tr><td colspan="3">
                    <asp:HiddenField ID="hMode" runat="server" Value="VIEW" />
                </td></tr>
                <tr><td colspan="3">&nbsp;</td></tr>
                <tr>
                    <td colspan="3" style="text-align:left;">
                        <input type="button" id="btnCancel" name="btnCancel" value="Cancel" class="btnSmall" />
                        <input type="button" id="btnEdit" name="btnCancel" value="Edit" class="btnSmall" />
                        <asp:Button ID="btnSave" runat="server" Text="Update" 
                            CssClass="btnSmall no-display" ValidationGroup="INSERTNEW" />
                    </td>
                </tr>
                <tr><td colspan="3" style="text-align:left;">
                    <asp:ValidationSummary ID="validsums" runat="server" 
                        ValidationGroup="INSERTNEW" />
                </td></tr>
                <tr><td colspan="3" style="color:Red;"><%= ErrMsg %></td></tr>
            </table>
        
            <div id="listHolder" style="text-align:left;">
                <div id="btnAdd" class="btnSmall" title="Add Channel">Add Distributor</div>
                <table id="tblList" class="tblstyle" style="font-size: 12px; font-family: Arial;margin-top:10px;">
                    <thead>
                        <tr>
                            <th style="table-layout:fixed;width:90px;">Distributor Code</th>
                            <th style="table-layout:fixed;width:150px;">Distributor Name</th>
                            <th style="table-layout:fixed;width:150px;">PIC Name</th>
                            <th style="table-layout:fixed;width:120px;">PIC Name (on CL)</th>
                            <th>Address</th>
                            <th style="table-layout:fixed;width:30px;">&nbsp;</th>
                        </tr>
                    </thead>
                    <tbody><%= tableList %></tbody>
                </table>
            </div>
        </div>
    </form>
</asp:Content>
